package com.imooc.api.controller.user;

import com.imooc.grace.result.GraceJSONResult;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 粉丝管理
 */
@RequestMapping("fans")
public interface MyFansControllerApi {

    /**
     * 查询当前用户是否关注作家
     */
    @PostMapping("/isMeFollowThisWriter")
    GraceJSONResult isMeFollowThisWriter(@RequestParam String writerId, @RequestParam String fanId);

    /**
     * 用户关注作家，成为粉丝
     */
    @PostMapping("/follow")
    GraceJSONResult follow(@RequestParam String writerId, @RequestParam String fanId);

    /**
     * 取消关注，作家损失粉丝
     */
    @PostMapping("/unfollow")
    GraceJSONResult unfollow(@RequestParam String writerId, @RequestParam String fanId);

    /**
     * 查询我的所有粉丝列表
     */
    @PostMapping("/queryAll")
    GraceJSONResult queryAll(@RequestParam String writerId, @RequestParam Integer page, @RequestParam Integer pageSize);

    /**
     * 查询男女粉丝数量
     */
    @PostMapping("/queryRatio")
    GraceJSONResult queryRatio(@RequestParam String writerId);

    /**
     * 根据地域查询粉丝数量
     */
    @PostMapping("/queryRatioByRegion")
    GraceJSONResult queryRatioByRegion(@RequestParam String writerId);

}
